import request from '../utils/request';

// 获取所有用户
export const getAllUsers = (pageNum: number, pageSize: number, username: string = '') => {
    return request.get('/api/users', {
        params: { pageNum, pageSize, username }
    });
};
// 删除用户
export const deleteUser = (username: string) => {
    return request.delete(`/api/users/${username}`);
};
// 更新用户信息
export const updateUser = (id: number, updatedUser: { username: string; password: string; role: string }) => {
    return request.put(`/api/users/${id}`, updatedUser);
};